
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<jsp:directive.page import="java.sql.*"/>
<jsp:directive.page import="Connectivity.ConnectionManager"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String Activity = request.getParameter("Activity")!=null?request.getParameter("Activity"):"2";
 
String status = request.getParameter("status")!=null?request.getParameter("status"):"";
String empno = request.getParameter("employee_id")!=null?request.getParameter("employee_id"):"";
String callentryno= request.getParameter("callentry_id")!=null?request.getParameter("callentry_id"):"";
String callstype= request.getParameter("callstype")!=null?request.getParameter("callstype"):"OPEN";
Connection con=ConnectionManager.getConnection();

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
 
    
    <title> CallAssign </title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="/other/data.js"></script>
    
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>

  
 <script>
 
function insertParam(key, value) 
{    
	key = escape(key); value = escape(value);
    var kvp = document.location.search.substr(1).split('&');
 	if (kvp == '') 
 	{
 	document.location.search = '?' + key + '=' + value;
 	}
 	else 
 	{
 	var i = kvp.length; var x; while (i--) 
 	{
 	  x = kvp[i].split('='); 
 	if (x[0] == key) 
  {
   x[1] = value;
   kvp[i] = x.join('=');
   break;
  }
  }
  if (i < 0) 
  { kvp[kvp.length] = [key, value].join('='); }
        //this will reload the page, it's likely better to store this until finished 
    document.location.search = kvp.join('&');         
  }
} 
function callDegree(obj)
{
		
		 if(obj.name=='callstype')
		 {insertParam((obj.name),(obj.value));}
		
	
 
			//document.callentry.action = "";
			//document.callentry.submit();
} 
</script>
  
  <body>
  
<table border=1 bordercolor=black width=100% height=100% cellspacing=0>
<tr><td>
<table align=right border=1 bordercolor=black height=50% width=100% cellspacing=0>
			<tr width=100%>
			 <td align=center colspan=10 ><font size=5><b><%=(session.getAttribute("firm_name"))%></b></font></td>
			 <td align=right colspan=1><img src="<%=basePath%>images\Company.jpg" height=119 width=109></td> 
			 </tr>
			
    <form name=callassign action=temp.jsp method=get>
    <%
    
  String role_id1=""+(session.getAttribute("role_id")); 
 String calltypestaus="CLOSED";
  if(role_id1.equals("1"))
  {
    }
    String space="&nbsp;&nbsp;&nbsp;&nbsp;";
     %>  
    <tr><td align=center   colspan=11><font size=4 color=Blue> CALL ASSIGN REPORT</font></td></tr>
     <tr>
     <td colspan=1 rowspan=2 align=top><font size=4 color="light pink"><b>Sr.No.</b></font></td>
     <td colspan=1 rowspan=2><font size=2 color="light pink"><b>ASSIGN DATE </b></font></td>
     <td colspan=1 rowspan=2><font size=2 color="light pink"><b>COMPLAINT ID </b></font></td>
     <td colspan=3 rowspan=2><font size=2 color="light pink"><b>CUSTOMER NAME <%=space%><%=space%></b></font></td>
     <td colspan=1 rowspan=2><font size=2 color="light pink"><b>BRANCH</b></font></td>
    
     <td colspan=1 rowspan=2><font size=2 color="light pink"><b>ISSUE</b></font></td>
     <td colspan=1 rowspan=2><font size=2 color="light pink"><b>ITEM</b></font></td>
     <td colspan=1 rowspan=2><font size=2 color="light pink"><b>EMPLOYEE NAME</b></font></td>
      <td colspan=1 rowspan=2><font size=2 color="light pink"><b>TYPE</b></font></td>
     </tr> 
      
     <%
     boolean flag=false;
     int count=0;
     String emp_id="",call_details="",item="",call_status="";
     String compalint_id="-",customer_name="-",area="-",cust_type="-",callentry_id="",assigndate="",employee_name="";
    try
    {
   	CallableStatement cstmt = null;
		ResultSet calldisplayrs = null;
 
			cstmt = con.prepareCall("{?=call fun_retrieve_callassigned_report(?,?)}");
			cstmt.registerOutParameter(1, Types.OTHER);
			cstmt.setString(2,calltypestaus);
			cstmt.setObject(3, calldisplayrs);
			
			con.setAutoCommit(false);
			cstmt.execute();
			
			calldisplayrs =(ResultSet) cstmt.getObject(1);	
 	
 	
 	
 	
 	
 	//String calldisplay="select function fun_retrieve_callentry("+calltypestaus+")";
    // PreparedStatement calldisplayprs=con.prepareStatement(calldisplay);
     //ResultSet calldisplayrs=calldisplayprs.executeQuery();
    while(calldisplayrs.next())
     {
     flag=true;count++;
     assigndate=calldisplayrs.getString(2).trim();
     compalint_id=calldisplayrs.getString(3);
     callentry_id= calldisplayrs.getString(1);
     customer_name=calldisplayrs.getString(4);
     area=calldisplayrs.getString(5);
     cust_type=calldisplayrs.getString(6);
     call_details=calldisplayrs.getString(7);
     item=calldisplayrs.getString(8);
     employee_name=calldisplayrs.getString(9);
     call_status=calldisplayrs.getString(10);
 
 /*   String year1=""+(assigndate.split("-",0));
String month1=""+(assigndate.split("-",1));
String date1=""+(assigndate.split("-",2));
assigndate=date1+"-"+month1+"-"+year1; */
   
   %>
   <tr></tr>
   <tr>
        
    <td colspan=1 rowspan=2><font size=2 ><%=count%></font></td>
    <td colspan=1 rowspan=2><font size=2 color="BLACK"><%=assigndate %></font></td>
    <td colspan=1 rowspan=2><font size=2 color="BLACK"><%=compalint_id %></font></td>
    <td colspan=3 rowspan=2><font size=2 color="BLACK"><%=customer_name.toUpperCase() %></font></td>
    <td colspan=1 rowspan=2><font size=2 color="BLACK"><%=area %></font></td>
   
    <td colspan=1 rowspan=2 width=20%><font size=2 color="BLACK"><%=call_details.toUpperCase()%></font></td>      
    <td colspan=1 rowspan=2><font size=2 color="BLACK"><%=item %><%=space%></font></td>
    <td colspan=1 rowspan=2><font size=2 color="BLACK"><%=employee_name.toUpperCase()%></font></td>           
        <td colspan=1 rowspan=2><font size=2 color="BLACK"><%=cust_type.toUpperCase()%></font></td>   
   </tr>
   
   
    
   <%} %>
 
  <!--  <a href="paging.jsp">paging</a>
    -->
   </form>
   </table>
   <% 
    }
    catch(Exception e)
    {e.printStackTrace();}
    finally
    {
    con.close();
    } 
      %>
  </body>
</html>
